<template>
	<view class="mCopy" @click="doCopy(str)">
		<view class="">
			复制
		</view>
		<slot></slot>
	</view>
</template>

<script>
	export default {
		name: "m-copy",
		props: {
			type: {
				type: String,
				default: 'icon-fuzhi',
			},
			show: {
				type: Boolean,
				default: true,
			},
			str: String,
		},
		data() {
			return {

			};
		},
		methods: {
			handleCopy(v) {
				uni.setClipboardData({
					data: this.str,
				});
			},
		},
	}
</script>

<style lang="scss">
	image {
		width: 32rpx;
		height: 32rpx;
	}

	.mCopy {
		display: inline-block;

		&>view {
			padding: 4rpx 14rpx;
			background: #F6F6F6;
			border-radius: 10rpx;

			font-size: 24rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
		}
	}
</style>